package com.yx.gsyd.controller.admin;

import com.alibaba.fastjson.JSONObject;
import com.yx.gsyd.entity.SysConfig;
import com.yx.gsyd.sms.AliSMS;
import com.yx.gsyd.util.ResultView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/test")
public class TestController {

    @Autowired
    private AliSMS aliSMS;


    /**
     * 保存或者修改
     */
    @GetMapping(value = "/send")
    public ResultView send() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name", "廖柏凯");
        jsonObject.put("unit_name", "小军维修个体户");
        this.aliSMS.sendSms("13631722145",jsonObject.toJSONString(),"SMS_474865982");
        return ResultView.ok();
    }


}
